package com.itheima.Date.test;

import java.util.Date;

/*
Date类的构造方法和成员方法
setTime/getTime
 */
public class Demo2 {
    public static void main(String[] args) {
        Date date = new Date();
        System.out.println(date);//当前时间Wed Sep 23 20:09:22 CST 2020
        //在此处运用getTime方法就能狗获取毫秒值
        long time = date.getTime();//获取的是当前时间的毫秒值
        System.out.println(time);//1600862676350
        long time2 = System.currentTimeMillis();
        System.out.println(time2);//1600862676350

        //setTime是用来是指原始时间的基础上设置时间
        date.setTime(1000L*3600);//在原世纪初的时间前进一小时
        System.out.println(date);//Thu Jan 01 09:00:00 CST 1970


    }
}
